import com.itheima.hibernate.entity.students;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.junit.Test;

public class test {
    @Test
    public void tstt(){
        Configuration cfg = new Configuration().configure();;
        SessionFactory sess = cfg.buildSessionFactory();
        Session session = sess.openSession();
        session.beginTransaction();

        students students= new students();
        students.setName("jkqqqqsssqh");
        students.setAge(22338);
        session.save(students);
        session.getTransaction().commit();
        session.close();
        sess.close();

    }
}
